package com.example.demo.service.impl;


import com.example.demo.dao.UserDao;

import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User login(String username, String password) {
        return userDao.login(username, password);
    }

    @Override
    public int add(User user) {
      return   userDao.add(user);
    }

    @Override
    public User findByUserName(String username) {
        return userDao.findByUserName(username);
    }


    @Override
    public void update(User user) {
        userDao.update(user);
    }

}
